package vn.fpt.fsoft.entities;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author MinhNC7
 * 
 */
@Entity
@Table(name = "tbWeekday")
public class TBWeekday {
	private int weekdayID;
	private String weekday;
	private Set<OpeningTime> openingTime = new HashSet<OpeningTime>(0);

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public int getWeekdayID() {
		return weekdayID;
	}

	public void setWeekdayID(int weekdayID) {
		this.weekdayID = weekdayID;
	}

	@Column(name = "Weekday", length = 10, nullable = false)
	public String getWeekday() {
		return weekday;
	}

	public void setWeekday(String weekday) {
		this.weekday = weekday;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "weekday")
	public Set<OpeningTime> getOpeningTime() {
		return openingTime;
	}

	public void setOpeningTime(Set<OpeningTime> openingTime) {
		this.openingTime = openingTime;
	}

	public TBWeekday(int weekdayID, String weekday, Set<OpeningTime> openingTime) {
		this.weekdayID = weekdayID;
		this.weekday = weekday;
		this.openingTime = openingTime;
	}

	public TBWeekday(int weekdayID, String weekday) {
		this.weekdayID = weekdayID;
		this.weekday = weekday;
	}

	public TBWeekday() {

	}
}
